home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Sample Code Update 01⁄96 / Fragment Tool / Sources / Prototypes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-20  |  6.1 KB  |  201 lines  |  [TEXT/MPCC]

  1. /*
  2.     File:        Prototypes.h
  3.  
  4.     Contains:    Routine prototypes
  5.  
  6.     Written by:    Chris White, Developer Technical Support
  7.     
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9.     
  10.     Change History (most recent first):
  11.     
  12.                   9/28/95    CW        First release
  13.  
  14. */
  15.  
  16.  
  17.  
  18. #ifndef __PROTOTYPES__
  19. #define __PROTOTYPES__
  20.  
  21.  
  22.  
  23. #ifndef __TYPES__
  24.     #include <Types.h>
  25. #endif
  26.  
  27. #ifndef __WINDOWS__
  28.     #include <Windows.h>
  29. #endif
  30.  
  31. #ifndef __WINDOWS__
  32.     #include <Files.h>
  33. #endif
  34.  
  35.  
  36.  
  37. #ifndef __FRAGMENTTOOL__
  38.     #include "FragmentTool.h"
  39. #endif
  40.  
  41. #include "FragmentStuff.h"
  42.  
  43.  
  44.  
  45.  
  46. #if DEBUGGING
  47. void DebugStrNum ( Str255 str, long num );
  48. #endif
  49.  
  50.  
  51.  
  52.  
  53. // Initialization.c
  54. void InitToolbox ( void );
  55. void InitApplication ( void );
  56. static Boolean CheckConfiguration ( void );
  57.  
  58.  
  59. // AppleEvents.c
  60. void InstallAppleEventHandlers(void);
  61.  
  62.  
  63. // Drag.c
  64. OSErr InstallDragHandlers ( WindowRef theWindow );
  65. void RemoveDragHandlers ( WindowRef theWindow );
  66. OSErr InitDragHandlers ( void );
  67.  
  68. // DialogsStuff.h
  69. void DoDialogContentClick ( DialogRef theDialog, EventRecord* theEvent );
  70. void DoDialogItemHit ( DialogRef theDialog, int16 theItem );
  71. OSErr AddHFSPromise ( DragReference theDrag, ItemReference theItem );
  72.  
  73.  
  74. // Fragments.c
  75. OSErr ParseResource ( Handle theResource, tHeaderHan privateData );
  76. OSErr BuildResource ( tHeaderHan privateData, Handle theResource );
  77.  
  78. OSErr CopyFragment ( tHeaderHan sourceHeader, FSSpecPtr sourceSpec, int16 sourceIndex,
  79.                         tHeaderHan targetHeader, FSSpecPtr targetSpec );
  80. OSErr DeleteFragment ( tHeaderHan theHeader, FSSpecPtr theSpec, int16 theIndex );
  81. tItemPtr GetNthItem ( tHeaderHan theHeader, int16 theIndex );
  82. tItemPtr GetLastItem ( tHeaderHan theHeader );
  83. int16 GetItemCount ( tHeaderHan theHeader );
  84.  
  85. OSErr AppendFileData ( FSSpecPtr source, FSSpecPtr target, long* offset, long* length );
  86.  
  87. OSErr IncrementTempUsageCount ( tItemPtr theItem );
  88. OSErr DecrementTempUsageCount ( tItemPtr theItem );
  89. int GetTempUsageCount ( tItemPtr theItem );
  90. FSSpecPtr GetTempSpecPtr ( tItemPtr theItem );
  91.  
  92.  
  93. // Menus.c
  94. void MenuDispatch ( int32 menuResult );
  95. void AdjustMenus ( void );
  96.  
  97.  
  98. // Windows.c
  99. void DoNewDocument ( void );
  100. void DoOpenDocument ( void );
  101. OSErr OpenDocument ( FSSpecPtr fileSpec, StringPtr documentName );
  102.  
  103.     // Did the user cancel?
  104. Boolean DoCloseAllDocuments ( void );
  105. Boolean DoCloseDocument ( WindowRef theWindow );
  106. Boolean DoSaveBeforeClosing ( WindowRef theWindow );
  107. Boolean DoSave ( WindowRef theWindow );
  108. Boolean DoSaveAs ( WindowRef theWindow );
  109.  
  110. Boolean IsDocumentDirty ( WindowRef theWindow );
  111. void SetDocumentDirty ( WindowRef theWindow, Boolean bIsDirty );
  112.  
  113. void AddFragToList ( ListRef theList, tItemPtr theItem );
  114. void UpdateFragInList ( WindowRef theWindow, int16 theIndex, StringPtr newName );
  115.  
  116. OSErr CreateWindowInfo ( WindowRef windowRef, Size infoSize );
  117.  
  118. OSErr CopyWindowFragment ( WindowRef source, int16 sourceIndex, WindowRef target );
  119. OSErr MoveWindowFragment ( WindowRef source, int16 sourceIndex, WindowRef target );
  120. OSErr DeleteWindowFragment ( WindowRef theWindow, int16 theIndex );
  121. tItemPtr GetNthWindowItem ( WindowRef theWindow, int16 theIndex );
  122. int16 GetIndexFromNthWindowItem ( WindowRef theWindow, int16 theIndex );
  123.  
  124.  
  125. // Lists.c
  126. void InitListClickLoop ( void );
  127. void AddToList ( ListRef theList, Str255 theString );
  128. void UpdateList ( ListRef theList, int16 theIndex, Str255 theString );
  129. void DeleteFromList ( ListRef theList, int16 theIndex );
  130. Boolean HandleListClick ( WindowRef theWindow, EventRecord* event );
  131. Boolean PtInList ( Point localPt, ListRef theList );
  132. void GetListRect ( Rect* theRect, ListRef theList );
  133. Boolean GetFirstSelection ( ListRef theList, Cell* theCell );
  134. Boolean GetSelection ( ListRef theList, int16* theIndex );
  135.  
  136.  
  137.  
  138. /*
  139.     TO DO:
  140.         Sort this lot out
  141. */
  142.  
  143.  
  144. void SetWListRef ( WindowRef theWindow, ListHandle theList );
  145. ListHandle GetWListRef ( WindowRef theWindow );
  146.  
  147.  
  148. OSErr CreateDocumentWindow ( WindowRef* windowRef, Str255 windowTitle,
  149.                                 tContentsProcPtr contentsProc, void* refCon );
  150. WindowRef DestroyDocumentWindow ( WindowRef windowRef );
  151.  
  152. Boolean IsMovableModal ( WindowRef theWindow );
  153. void DrawClippedGrowIcon (WindowRef wp);
  154. WindowRef CreateNewDocument ( void );
  155. void OpenNewDocument ( void );
  156. void DoUpdate ( EventRecord *theEvent );
  157. void DoActivate (EventRecord *theEvent);
  158. void DoContentClick (WindowRef wp, EventRecord *theEvent);
  159. void DoGrowWindow(WindowRef wp, EventRecord *theEvent);
  160. void DoDragWindow(WindowRef wp, EventRecord *theEvent);
  161. void DoZoomWindow(WindowRef wp, EventRecord *theEvent, int16 WindowPart);
  162. void DoIdleWindow (WindowRef wp);
  163. void ClipToContentArea (WindowRef wp);
  164. void ResetClip (WindowRef wp);
  165. ListHandle GetWListRef ( WindowRef theWindow );
  166. void SetWFileRef ( WindowRef theWindow, int16 theFileRef );
  167. int16 GetWFileRef ( WindowRef theWindow );
  168. void SetWFileSpec ( WindowRef theWindow, FSSpecPtr theSpec );
  169. DialogRef CreateExportsDialog ( Str255 theDocTitle );
  170. OSErr CreateListDialog ( DialogRef* dialogRef, int16 dialogID, StringPtr dialogTitle,
  171.                             tContentsProcPtr contentsProc, void* refCon );
  172. OSErr CreateInfoDialog ( DialogRef* dialogRef, StringPtr dialogTitle, WindowRef theWindow, int16 theIndex );
  173. void SetWindowType ( WindowRef theWindow, int16 theType );
  174. int16 GetWindowType ( WindowRef theWindow );
  175. void SetWindowSubType ( WindowRef theWindow, int16 theType );
  176. int16 GetWindowSubType ( WindowRef theWindow );
  177. pascal void OutlineUserItem ( DialogRef theDialog, short theItem );
  178. StringPtr ConcatPStr ( Str255 ioFirstStr,Str255 inSecondStr, int16 inDestSize );
  179. StringPtr CopyPStr ( Str255    inSourceStr, StringPtr outDestStr, int16 inDestSize );
  180. StringPtr OSTypeToPStr ( OSType inOSType, StringPtr outString );
  181. DialogRef DestroyDialog ( DialogRef theDialog );
  182. OSErr AddFragments ( ListRef theList, void* refCon );
  183. OSErr AddFragmentExports ( ListRef theList, void* refCon );
  184. OSErr AddDocuments ( ListRef theList, void* refCon );
  185. WindowRef GetIndexedDocumentWindow ( int theIndex );
  186. void MoveCopySelectedFragments ( DialogRef theDialog, Boolean bMove );
  187.  
  188. OSErr SetDialogValues ( DialogRef theDialog, tItemPtr theItem );
  189. OSErr GetDialogValues ( DialogRef theDialog, tItemPtr theItem );
  190.  
  191.  
  192. void AddFragToList ( ListRef theList, tItemPtr theItem );
  193. void DeleteFragFromList ( ListRef theList, int16 theIndex );
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200. #endif // define __PROTOTYPES__
  201.